#pragma once
#include <cv.h>
#include <highgui.h>
#include <iostream>
#include <fstream>
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#include "Detection.h"
#include "CapturingAndStoring.h"
#include "LearningAndRecognition.h"
#include <sstream>
#include <string>
class FacialRecognition
{
public:
	FacialRecognition(void);
	~FacialRecognition(void);
	void Run(int argc, char * argv[]);		
	static IplImage * inputImage;
	static CvRect faceRect;
	char * INPUT_IMAGE;
private:
	CvCapture * capture;
	CvPoint pt1, pt2;
	Detection detection;
	CapturingAndStoring capturingAndStoring;
	void CaptureFromCAMAndDetectFace(int argc, char * argv[]);
	void CaptureImageFromCAMAndDetectThenRecognizeFaceInImage(int argc, char * argv[], CvHaarClassifierCascade * faceCascade); //While loop	
	CvHaarClassifierCascade * LoadCascade(const char * faceCascadeFilename);
	Lib::Thread<LearningAndRecognition, int> thread;
};